package cn.taobaoke.restful.domain;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 二级域名实体信息表. 不同用户对应一个条目.
 *
 * @author yangzuo
 * @since 2017-05-04 22:13
 */
@Getter
@Setter
@ToString
@Table(name = "tb_domain")
@Entity
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"})
@JsonInclude(JsonInclude.Include.NON_NULL)
public class DomainEntity implements Serializable {

    @Id
    @GeneratedValue
    private Long id;

    @Column(unique = true)
    private String domain;

    @Column(unique = true)
    private String datasourceType;

    @Column
    private String jdbcUrl;

    @Column
    private String jdbcUsername;

    @Column
    private String jdbcPassword;

    @Column
    private String customerName;

    @Column
    private String phoneNumber;

    @Column
    private String wechatId;

    @Column
    private String wechatName;

    @Column
    private String address;

//    @Column(unique = true)
    private String userDomain;
}
